﻿$(function () {
    refreshCode();

    //刷新验证码
    $(".verifyCode-img").click(function () {
        refreshCode();
    });

    function refreshCode() {
        var img = document.getElementById("imgVerifyCode");
        if (img != null) {
            var currentDate = new Date();
            img.src = '/Customer/VerifyCodeImage?ref=1&t=' + currentDate.getTime();
        }
    }

    //找回密码表单验证
    $("#getPassForm").validate({
        rules: {
            UserName: {
                required: true
            },
            VerifyCode: {
                required: true,
                minlength: 5,
                maxlength: 5
            }
        },
        submitHandler: function (form) {
            form.submit();
        }
    });
});